var arr = [1, 2, 3, 4, 5, 6];
var min = arr[0];
var max = arr[0];

for(var index in arr)
{
    if (arr[index] > max)
    {
        max = arr[index];
    }

    if (arr[index] < min)
    {
        min = arr[index];
    }
}

console.log(min);
console.log(max);